package collection.map;

import collection.Printer;
import org.junit.Test;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 1.继承自AbstractMap，基于hash算法
 * 2.不支持null键和null值
 * 3.线程安全（）实现ConcurrentMap接口
 * 4.无序
 */
public class ConcurrentHashMapTest {

    @Test
    public void testAdd() {
        Map<String, String> map = new ConcurrentHashMap<>();
        map.put("A", "A");
//		map.put("B", null);
//		map.put("C", null);
        map.put(null, "D");
        map.put("E", "E");
        System.out.println(map);
        Printer.printMap(map);
    }
}
